UPDATE
C1_OPERATE_LOG t
SET
t.end_date = NOW()
WHERE t.code = :code
AND (
t.end_date > NOW()
OR t.end_date IS NULL
)
AND EXISTS
(SELECT
1
FROM
c1_dictionary e
WHERE e.id = t.type_id
AND e.code = :typeCode)
<#if StringUtils.isNotBlank(businessCode)>
AND T.BUSINESS_CODE = :businessCode
</#if>
